Skip to content

Conversation

@Maleclypse
Copy link
Member

Summary

None

Purpose of change

Describe the solution

Is it really this easy? Just check the bool from map.h?

Describe alternatives you've considered

Terror and insanity.

Testing

Additional context

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Sep 17, 2025
@github-actions github-actions bot added the EOC: Effects On Condition Anything concerning Effects On Condition label Sep 17, 2025
@RenechCDDA
Copy link
Member

Is it really this easy? Just check the bool from map.h?

Yes, although you need definitions in the talker classes to specify. Something like this, for every class of talker that you intend to be able to use this function.

talker_character::is_wall_adjacent() const {
return get_map().is_wall_adjacent( me_chr_const->pos_bub() );
}

Note that the function name is somewhat misleading. It does NOT check for walls, it checks if the tiles are impassable.

Cataclysm-DDA/src/map.cpp

Lines 2366 to 2367 in 683a8c9

if( p != center && impassable( p ) ) {
return true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` EOC: Effects On Condition Anything concerning Effects On Condition json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants